<template>
  <el-dialog v-model="shows" title="流程管理" width="30%" :before-close="handleClose">
    <div style="width: 100%;height: 500px;display: flex;justify-content: center;">
    <el-steps direction="vertical" :active="activeName">
      <el-step :title="props.flowlist[0].reportName" />
      <el-step :title="props.flowlist[0].username" />
      <el-step :title="props.flowlist[1].username" />
    </el-steps>
  </div>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="handleClose">关闭</el-button>
      </span>
    </template>
  </el-dialog>
</template>
<script lang="ts" setup>
import {ElMessageBox} from "element-plus"
import { ref ,watch} from "vue"
const shows = ref(false)
const emit = defineEmits(['digChange'])
const activeName:any=ref(1)
const props = defineProps({
    flowlist:Array,
    show:Boolean
})
watch(
  () => props,
  (newVal) => {
     newVal.show?shows.value=true:shows.value=false;
     const statu1:any = props.flowlist[0];
     const statu2:any = props.flowlist[1];
     if(statu1.shState=='1'){
      activeName.value=1
     }else if(statu1.shState=='2'&&statu2.shState=='1'){
      activeName.value=2
     }else{
      activeName.value=3
     }
  },
  {deep:true}
)
const handleClose = (done: () => void) => {
      shows.value = false
      emit('digChange', shows.value)
}
</script>
<style scoped>
</style>
